package com.link.common.packet.recv;


import com.link.common.util.BinaryUtils;
import io.netty.buffer.ByteBuf;

public record LoginPacket(String username, String password){

    public static  LoginPacket fromBinary(ByteBuf buffer){
        int usernameLength  = buffer.readInt();

         String username = BinaryUtils.toString(buffer, usernameLength);

         int passwordLength= buffer.readInt();

         String password = BinaryUtils.toString(buffer, passwordLength);

        return new LoginPacket(username, password);





    }
}

